<!-- HTML header for doxygen 1.8.20-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=9"/>
	<meta name="generator" content="Doxygen 1.9.4"/>
	<meta name="viewport" content="width=device-width, initial-scale=1"/>
	<title>Raspberry Pi Pico SDK: include/hardware/claim.h Source File</title>
	<!-- <link href="tabs.css" rel="stylesheet" type="text/css"/> -->
	<script type="text/javascript" src="jquery.js"></script>
	<script type="text/javascript" src="dynsections.js"></script>
	<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
	<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
	<link href="doxygen.css" rel="stylesheet" type="text/css" />
	<link href="normalise.css" rel="stylesheet" type="text/css"/>
<link href="main.css" rel="stylesheet" type="text/css"/>
<link href="styles.css" rel="stylesheet" type="text/css"/>
</head>
<body>
	<div class="navigation-mobile">
		<div class="logo--mobile">
			<a href="/"><img src="logo-mobile.svg" alt="Raspberry Pi"></a>
		</div>
		<div class="navigation-toggle">
			<span class="line-1"></span>
			<span class="line-2">
				<p>Menu Toggle</p>
			</span>
			<span class="line-3"></span>
		</div>
	</div>
	<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
		<div class="logo">
			<a href="index.html"> <img src="logo.svg" alt="Raspberry Pi"></a>
			<span style="display: inline-block; margin-top: 10px;">
				v2.0.0
			</span>
		</div>
		<div class="navigation-footer">
			<img src="logo-mobile.svg" alt="Raspberry Pi">
			<a href="https://www.raspberrypi.com/" target="_blank">By Raspberry Pi Ltd</a>
		</div>
<!-- 		<div class="search">
			<form>
				<input type="search" name="search" id="search" placeholder="Search">
				<input type="submit" value="Search">
			</form>
		</div> -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('claim_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle"><div class="title">claim.h</div></div>
</div><!--header-->
<div class="contents">
<a href="claim_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="comment">/*</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span><span class="comment"> * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="comment"> *</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span><span class="comment"> * SPDX-License-Identifier: BSD-3-Clause</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="comment"> */</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span><span class="preprocessor">#ifndef _HARDWARE_CLAIM_H</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="preprocessor">#define _HARDWARE_CLAIM_H</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span> </div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="preprocessor">#include &quot;<a class="code" href="pico_8h.html">pico.h</a>&quot;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="preprocessor">#include &quot;<a class="code" href="rp2__common_2hardware__sync_2include_2hardware_2sync_8h.html">hardware/sync.h</a>&quot;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span> </div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno">   34</span><span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno">   35</span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span> </div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__claim.html#ga6487272cf1fa8d5b2e67f78bb5bdab4d">hw_claim_or_assert</a>(uint8_t *bits, uint bit_index, <span class="keyword">const</span> <span class="keywordtype">char</span> *message);</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno">   48</span> </div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno">   59</span><span class="keywordtype">int</span> <a class="code hl_function" href="group__hardware__claim.html#gacc8b9324cd6f327e57c6dcb8cbef1745">hw_claim_unused_from_range</a>(uint8_t *bits, <span class="keywordtype">bool</span> required, uint bit_lsb, uint bit_msb, <span class="keyword">const</span> <span class="keywordtype">char</span> *message);</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno">   60</span> </div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno">   70</span><span class="keywordtype">bool</span> <a class="code hl_function" href="group__hardware__claim.html#gab3aa24c90859fbc4da40b8fce8852f6e">hw_is_claimed</a>(<span class="keyword">const</span> uint8_t *bits, uint bit_index);</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno">   71</span> </div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno">   80</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__claim.html#ga9291a012435d3efff22c592d47e82b4a">hw_claim_clear</a>(uint8_t *bits, uint bit_index);</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno">   81</span> </div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno">   93</span>uint32_t <a class="code hl_function" href="group__hardware__claim.html#gac322717d266403fac74aed5cef23eb95">hw_claim_lock</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno">   94</span> </div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno">  102</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__claim.html#gae5ebb9e8ede55de49e6296953d731005">hw_claim_unlock</a>(uint32_t token);</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno">  103</span> </div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno">  104</span><span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno">  105</span>}</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno">  106</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno">  107</span> </div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno">  108</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="agroup__hardware__claim_html_ga6487272cf1fa8d5b2e67f78bb5bdab4d"><div class="ttname"><a href="group__hardware__claim.html#ga6487272cf1fa8d5b2e67f78bb5bdab4d">hw_claim_or_assert</a></div><div class="ttdeci">void hw_claim_or_assert(uint8_t *bits, uint bit_index, const char *message)</div><div class="ttdoc">Atomically claim a resource, panicking if it is already in use.</div><div class="ttdef"><b>Definition:</b> claim.c:21</div></div>
<div class="ttc" id="agroup__hardware__claim_html_ga9291a012435d3efff22c592d47e82b4a"><div class="ttname"><a href="group__hardware__claim.html#ga9291a012435d3efff22c592d47e82b4a">hw_claim_clear</a></div><div class="ttdeci">void hw_claim_clear(uint8_t *bits, uint bit_index)</div><div class="ttdoc">Atomically unclaim a resource.</div><div class="ttdef"><b>Definition:</b> claim.c:49</div></div>
<div class="ttc" id="agroup__hardware__claim_html_gab3aa24c90859fbc4da40b8fce8852f6e"><div class="ttname"><a href="group__hardware__claim.html#gab3aa24c90859fbc4da40b8fce8852f6e">hw_is_claimed</a></div><div class="ttdeci">bool hw_is_claimed(const uint8_t *bits, uint bit_index)</div><div class="ttdoc">Determine if a resource is claimed at the time of the call.</div><div class="ttdef"><b>Definition:</b> claim.c:17</div></div>
<div class="ttc" id="agroup__hardware__claim_html_gac322717d266403fac74aed5cef23eb95"><div class="ttname"><a href="group__hardware__claim.html#gac322717d266403fac74aed5cef23eb95">hw_claim_lock</a></div><div class="ttdeci">uint32_t hw_claim_lock(void)</div><div class="ttdoc">Acquire the runtime mutual exclusion lock provided by the hardware_claim library.</div><div class="ttdef"><b>Definition:</b> claim.c:9</div></div>
<div class="ttc" id="agroup__hardware__claim_html_gacc8b9324cd6f327e57c6dcb8cbef1745"><div class="ttname"><a href="group__hardware__claim.html#gacc8b9324cd6f327e57c6dcb8cbef1745">hw_claim_unused_from_range</a></div><div class="ttdeci">int hw_claim_unused_from_range(uint8_t *bits, bool required, uint bit_lsb, uint bit_msb, const char *message)</div><div class="ttdoc">Atomically claim one resource out of a range of resources, optionally asserting if none are free.</div><div class="ttdef"><b>Definition:</b> claim.c:31</div></div>
<div class="ttc" id="agroup__hardware__claim_html_gae5ebb9e8ede55de49e6296953d731005"><div class="ttname"><a href="group__hardware__claim.html#gae5ebb9e8ede55de49e6296953d731005">hw_claim_unlock</a></div><div class="ttdeci">void hw_claim_unlock(uint32_t token)</div><div class="ttdoc">Release the runtime mutual exclusion lock provided by the hardware_claim library.</div><div class="ttdef"><b>Definition:</b> claim.c:13</div></div>
<div class="ttc" id="apico_8h_html"><div class="ttname"><a href="pico_8h.html">pico.h</a></div></div>
<div class="ttc" id="arp2__common_2hardware__sync_2include_2hardware_2sync_8h_html"><div class="ttname"><a href="rp2__common_2hardware__sync_2include_2hardware_2sync_8h.html">sync.h</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->

	<script src="main.js"></script>
</body>
</html>